{extend name="top/index" /}
{block name="main"}
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
	<div class="page-content">
		<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
						<h4 class="modal-title">Modal title</h4>
					</div>
					<div class="modal-body">
						Widget settings form goes here
					</div>
					<div class="modal-footer">
						<button type="button" class="btn blue">Save changes</button>
						<button type="button" class="btn default" data-dismiss="modal">Close</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal-dialog -->
		</div>
		<!-- /.modal -->
		<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<!-- BEGIN STYLE CUSTOMIZER -->
		<div class="theme-panel hidden-xs hidden-sm">
			<!-- <div class="toggler">
            </div> -->
			<div class="toggler-close">
			</div>
			<div class="theme-options">
				<div class="theme-option theme-colors clearfix">
						<span>
							 THEME COLOR
						</span>
					<ul>
						<li class="color-black current color-default" data-style="default">
						</li>
						<li class="color-blue" data-style="blue">
						</li>
						<li class="color-brown" data-style="brown">
						</li>
						<li class="color-purple" data-style="purple">
						</li>
						<li class="color-grey" data-style="grey">
						</li>
						<li class="color-white color-light" data-style="light">
						</li>
					</ul>
				</div>
				<div class="theme-option">
						<span>
							 Layout
						</span>
					<select class="layout-option form-control input-small">
						<option value="fluid" selected="selected">Fluid</option>
						<option value="boxed">Boxed</option>
					</select>
				</div>
				<div class="theme-option">
						<span>
							 Header
						</span>
					<select class="header-option form-control input-small">
						<option value="fixed" selected="selected">Fixed</option>
						<option value="default">Default</option>
					</select>
				</div>
				<div class="theme-option">
						<span>
							 Sidebar
						</span>
					<select class="sidebar-option form-control input-small">
						<option value="fixed">Fixed</option>
						<option value="default" selected="selected">Default</option>
					</select>
				</div>
				<div class="theme-option">
						<span>
							 Sidebar Position
						</span>
					<select class="sidebar-pos-option form-control input-small">
						<option value="left" selected="selected">Left</option>
						<option value="right">Right</option>
					</select>
				</div>
				<div class="theme-option">
						<span>
							 Footer
						</span>
					<select class="footer-option form-control input-small">
						<option value="fixed">Fixed</option>
						<option value="default" selected="selected">Default</option>
					</select>
				</div>
			</div>
		</div>
		<!-- END STYLE CUSTOMIZER -->
		<!-- BEGIN PAGE HEADER-->
		<div class="row">
			<div class="col-md-12">
				<!-- BEGIN PAGE TITLE & BREADCRUMB-->
				<h3 class="page-title">
					档案库
				</h3>
				<ul class="page-breadcrumb breadcrumb navs">
					<li>
						<i class="fa fa-home"></i>
						<a data-id="0" href="{:url('index/index/index')}">
							Home
						</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a  data-id="0" href="{:url('index/arc/index')}">
							档案库
						</a>
						<i class="fa fa-angle-right"></i>
					</li>
					{$nav_html}
				</ul>
				<!-- END PAGE TITLE & BREADCRUMB-->
			</div>
		</div>
		<form class="form-inline">
			<div class="form-group">
				<label class="sr-only" for="exampleInputEmail3"></label>
				<input type="text" class="form-control" id="search" placeholder="search">
			</div>
			<button type="submit" class="btn btn-success">搜索</button>
		</form>
		<!-- END PAGE HEADER-->
		<!-- BEGIN PAGE CONTENT-->
		<div class="row">
			<div class="col-md-12">
				<!-- Begin: life time stats -->
				<div class="portlet">
					<div class="portlet-title">
						<div class="caption">
							<i class="fa fa-gift"></i>档案库
						</div>
						<div class="actions">
							{if condition="$_SESSION['think']['username'][0]['user_name'] eq 'admin'"}
							<div class="btn-group">
								<a class="btn blue yellow-stripe" href="#" data-toggle="dropdown">
									<i class="fa fa-plus"></i> 新建 <i class="fa fa-angle-down"></i>
								</a>
								<ul class="dropdown-menu pull-right">
									<li>
										<a class="getmodal" href="{:url('index/Arc/addFolder')}">
											<i class="fa fa-folder-o" style="color: #FFB74D;font-size: 1em;line-height: .75em"></i> 文件夹
										</a>
									</li>
									<!-- <li>
										<a class="getmodal" href="{:url('index/Arc/addWord')}">
											<i class="fa fa-file-word-o" style="color: #5C6BC0;font-size: 1em;line-height: .75em"></i> Word 文档
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/addPpt')}">
											<i class="fa fa-file-powerpoint-o" style="color: #FF6E40;font-size: 1em;line-height: .75em"></i> PowerPoint 文档
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/addExcel')}">
											<i class="fa fa-file-excel-o" style="color: #43A047;font-size: 1em;line-height: .75em"></i> Excel 文档
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/addHtml')}">
											<i class="fa fa-file-code-o" style="color: #BDBDBD;font-size: 1em;line-height: .75em"></i> 页面
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/addTxt')}">
											<i class="fa fa-file-text-o" style="color: #BDBDBD;font-size: 1em;line-height: .75em"></i> 标记文本
										</a>
									</li> -->
									<!--<li>
										<a class="getmodal" href="{:url('index/Prearc/addFolder')}">
											<i class="fa fa-file-text-o" style="color: #BDBDBD;font-size: 1em;line-height: .75em"></i> 根据模板创建
										</a>
									</li>-->
								</ul>
							</div>
							<div class="btn-group">
								
								<a class="btn green yellow-stripe" href="#" data-toggle="dropdown">

									<i class="fa fa-upload"></i> 上传 <i class="fa fa-angle-down"></i>
								</a>
								<ul class="dropdown-menu pull-right">
									<li>
										<a class="getmodal" href="{:url('index/Arc/upload',array('id'=>1))}">
											<i class="fa fa-folder-o" style="color: #FFB74D;font-size: 1em;line-height: .75em"></i> 档案
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/upload',array('id'=>2))}">
											<i class="fa fa-folder-o" style="color: #FFB74D;font-size: 1em;line-height: .75em"></i> 图片
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Arc/upload',array('id'=>3))}">
											<i class="fa fa-folder-o" style="color: #FFB74D;font-size: 1em;line-height: .75em"></i> 视频
										</a>
									</li>
									<li>
										<a class="getmodal" href="{:url('index/Prearc/upload',array('id'=>4))}">
											<i class="fa fa-folder-o" style="color: #FFB74D;font-size: 1em;line-height: .75em"></i> 文书档案案卷
										</a>
									</li>
								</ul>
							</div>

							<!-- <div class="btn-group">
								<a class="btn default yellow-stripe getmodal" href="{:url('index/Arc/settags')}" data-toggle="dropdown">
									<i class="fa fa-tags"></i> 标签
								</a>
							</div> -->
							{/if}
						</div>
					</div>
					<div>共有N项</div>
					<div class="portlet-body">
						<div class="table-container">
							<div class="table-actions-wrapper">
									<span>
									</span>
								<select class="table-group-action-input form-control input-inline input-small input-sm">
									<option value="">Select...</option>
									<option value="publish">Publish</option>
									<option value="unpublished">Un-publish</option>
									<option value="delete">Delete</option>
								</select>
								<button class="btn btn-sm yellow table-group-action-submit"><i class="fa fa-check"></i> Submit</button>
							</div>
							<div class="row">
								<div class="col-md-6" style="float: left;width: 30%;">
									<div class="portlet blue box" >
										<div class="portlet-title">
											<div class="caption">
												<i class="fa fa-cogs"></i>文件夹导航
											</div>
											<div class="tools" >
												<a class="config getmodal" title="编辑" href="{:url('index/Arc/folderEdit')}"></a>

												<a href="javascript:;" class="reload">
												</a>

											</div>
										</div>
										<div class="portlet-body" >
											<div id="tree_1" class="tree-demo" style="overflow-x:scroll;">
												{$tree}
											</div>
										</div>
									</div>
								</div>
								<div style="float: right;width: 70%;">
									<table class="table table-striped table-bordered table-hover" id="datatable_products">
										<thead>
										<tr role="row" class="heading">
											<th width="1%">
												<input type="checkbox" class="group-checkable">
											</th>
											<th width="20%">
												标题
											</th>
											<th width="20%">
												文件名
											</th>
											<th width="10%">
												管理人
											</th>
											<th width="10%">
												大小
											</th>
											<th width="15%">
												修改时间
											</th>
											<th width="10%">
												操作
											</th>
										</tr>

										{foreach $a_data as $ad}
										<tr role="row" class="filter">
											<td><input type="checkbox" class="group-checkable"></td>
											<td>
												<p id="title">{$ad.arc_title}</p>
											</td>
											
											<td>
												<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/onRead')}">
													{switch name="ad['arc_type']" }
													{case value="docx"}<i class="fa fa-file-word-o" style="color: #5C6BC0;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="xlsx"}<i class="fa fa-file-excel-o" style="color: #43A047;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="txt"}<i class="fa fa-file-text-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="pptx"}<i class="fa fa-file-powerpoint-o" style="color: #FF6E40;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="html"}<i class="fa fa-file-code-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="doc"}<i class="fa fa-file-word-o" style="color: #5C6BC0;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{case value="xls"}<i class="fa fa-file-excel-o" style="color: #43A047;font-size: 1.33333333em;line-height: .75em"></i>{/case}
													{default /}<i class="fa fa-file-code-o" style="color: #BDBDBD;font-size: 1.33333333em;line-height: .75em"></i>
													{/switch}
													<p id="name">{$ad.arc_name}.{$ad.arc_type}</p>
													{switch name="ad['audit_status']" }
													{case value="0"}<span class="label label-sm label-info">初始</span>{/case}
													{case value="1"}<span class="label label-sm label-primary " >待归档</span>{/case}
													{case value="2"}<span  class="label label-sm label-success " >已归档</span>{/case}
													{case value="3"}<span class="label label-sm label-danger "  >已打回</span>{/case}
													{/switch}
												</a>
											</td>
											<td>
												{present name="$_SESSION['think']['user_data'][$ad['create_user_id']]['user_name']"}
													{$_SESSION['think']['user_data'][$ad['create_user_id']]['user_name']}
												{else /}
													{$ad['username']}(已禁用)
												{/present}
											</td>
											<td>{:count_size($ad['arc_file_size'])}</td>
											<td>{$ad.update_time}</td>
											<td>
												<div class="btn-group">
													<a class=" yellow-stripe" href="#" data-toggle="dropdown">
														<i class="fa fa-caret-square-o-down" style="font-size: 1.33333333em;color:#BDBDBD "></i>
													</a>
													<ul class="dropdown-menu pull-right">
														<li>
															<a class="geturl" data-id="{$ad.arc_id}" data-href="{:url('index/Arc/download')}" href="javascript:;">下载原文件</a>
														</li>
														<!-- <li>
															<a class="getmodal" href="{:url('index/Arc/addFolder')}">下载水印PDF</a>
														</li> -->
														<li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/settag')}">设置标签</a>
														</li>
														<li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/shouc')}">收藏</a>
														</li>
														<li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/rename')}">重命名</a>
														</li>
														<!-- <li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/copy')}">复制</a>
														</li> -->
														<li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/remove')}">移动</a>
														</li>
														<li>
															<a class="getmodal" data-id="{$ad.arc_id}" href="{:url('index/Arc/delete')}">删除</a>
														</li>
													</ul>
												</div></td>
										</tr>
										{/foreach}
										<!--<td>
                                            <input type="checkbox" class="group-checkable">
                                        </td>
                                        <td>
                                            1
                                        </td>
                                        <td>
                                            1
                                        </td>
                                        <td>
                                            1
                                        </td>
                                        <td>
                                            1
                                        </td>
                                        <td>
                                            1
                                        </td>-->

										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>

						</div>
					</div>
					<!-- End: life time stats -->
				</div>
			</div>

			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="footer">
	<div class="footer-inner">
		2018 &copy; 仁聚科技
	</div>
	<div class="footer-tools">
		<span class="go-top">
			<i class="fa fa-angle-up"></i>
		</span>
	</div>
</div>


<script src="/static/assets/plugins/jstree/dist/jstree.min.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script src="/static/assets/scripts/custom/ui-tree.js"></script>
<script src="/static/assets/scripts/core/app.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/plugins/jstree/dist/themes/default/style.min.css"/>
<script src="/static/assets/scripts/core/dt.js"></script>
<script type="text/javascript">
   $("#title").each(function() {
	var maxwidth = 30;//显示多少字符
	if ($(this).text().length > maxwidth) {
	$(this).text($(this).text().substring(0, maxwidth));
	$(this).html($(this).html() + '...');
	}
	});
   $("#name").each(function() {
	var maxwidth = 40;//显示多少字符
	if ($(this).text().length > maxwidth) {
	$(this).text($(this).text().substring(0, maxwidth));
	$(this).html($(this).html() + '...');
	}
	});
</script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    dt().getModals();
    dt().getUrl();
    jQuery(document).ready(function() {
        App.init();
        UITree.init();
        $("#tree_1").on('changed.jstree', function (e, data) {
            var id = data.node.data.id;
            $.ajax({
                url:'{:url(\'index/Arc/setCateId\')}',
                data:{cate_id:id},
                type:'post',
                dataType:'json',
                success:function (e) {
                    window.location.href = '{:url(\'index/Arc/index\')}';
                }
            });
        });
    });
</script>
<script>
		$(function(){
			$('.arc').addClass("active");
		});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>
{/block}
